<?php
namespace app\wempapi\controller;

use app\common\controller\Frontend;
use app\weapp\model\Activity as ActivityModel;
use app\common\library\ImageBind;

class Special extends Frontend
{
    protected array $noNeedLogin = ['*'];
   
   public function index(){
        $page = $this->request->param('page',1);
        $pageSize = $this->request->param('page_size',10);
        $list = ActivityModel::where('status',1)->page($page,$pageSize)->select();
        $this->success('',$list);
    }
    /**
     * 获取活动详情
     */
    public function detail(){
        
        $id = $this->request->param('id','');
        $info = ActivityModel::find($id);
        $this->success('',$info);
    }
    public function qrcode(){
        $id = $this->request->param('id','');
        ImageBind::bulidImage($id);
        return $this->success('',$this->request->domain().'/static/images/special/'.$id.'.jpg');
    }

}